package cu.ds.logicalsync.fytasrealm.model;

/**
 * PositionMap is a tile composition in Map
 * 
 * @author pretty.tida
 */
public class PositionMap extends Position {

	private PositionColor pColor;
	private String worldNameInMap;
	
	/**
	 * Create new PositionMap
	 * @param i row number
	 * @param j column number
	 */
	public PositionMap(int i, int j) {
		super(i,j);
		this.pColor = PositionColor.White;
	}

	/**
	 * Parse the PositionColor
	 * @param status
	 */
	public void setPositionColor(String status,boolean worldStatus) {
				
		if (status == "Me") {
			this.pColor = PositionColor.Blue;
		}
		else if (status == "Others") {
			if (worldStatus == true) { /* owner is in world */
				this.pColor = PositionColor.Green;
			}
			else if (worldStatus == false) { /* owner is not in world */
				this.pColor = PositionColor.Red;	
			}	
		}
		else { //no status
			this.pColor = PositionColor.White;
		}
	}

	/**
	 * Get MapColor for this PositionMap
	 * @return
	 */
	public PositionColor getPositionColor() {
		return this.pColor;
	}
	
	/**
	 * Get WorldNameInMap at a specific position in map
	 * @return String of worldNameInMap
	 */
	public String getWorldNameInMap() {
		return worldNameInMap;
	}
	/**
	 * Set WorldNameInMap
	 */
	public void setWorldNameInMap(String worldNameInMap) {
		this.worldNameInMap = worldNameInMap;
	}


}
